import Vue from 'vue'
import Router from 'vue-router'

Vue.use(Router)

/* Layout */
import Layout from '@/layout'

/**
 * Note: sub-menu only appear when route children.length >= 1
 * Detail see: https://panjiachen.github.io/vue-element-admin-site/guide/essentials/router-and-nav.html
 *
 * hidden: true                   if set true, item will not show in the sidebar(default is false)
 * alwaysShow: true               if set true, will always show the root menu
 *                                if not set alwaysShow, when item has more than one children route,
 *                                it will becomes nested mode, otherwise not show the root menu
 * redirect: noRedirect           if set noRedirect will no redirect in the breadcrumb
 * name:'router-name'             the name is used by <keep-alive> (must set!!!)
 * meta : {
    roles: ['admin','editor']    control the page roles (you can set multiple roles)
    title: 'title'               the name show in sidebar and breadcrumb (recommend set)
    icon: 'svg-name'             the icon show in the sidebar
    breadcrumb: false            if set false, the item will hidden in breadcrumb(default is true)
    activeMenu: '/example/list'  if set path, the sidebar will highlight the path you set
  }
 */

/**
 * constantRoutes
 * a base page that does not have permission requirements
 * all roles can be accessed
 */
export const constantRoutes = [
  {
    path: '/login',
    component: () => import('@/views/login/index'),
    hidden: true
  },
  {
    path: '/ones',
    name: 'ones',
    hidden: true,
    component: () => import('@/views/cxtj/gkjkfx/one'),
    meta: { title: '税收概况监控', icon: 'rshujucaiji' },
  },
  {
    path: '/twos',
    name: 'twos',
    hidden: true,
    component: () => import('@/views/cxtj/gkjkfx/two'),
    meta: { title: '经营概况监控', icon: 'rshujucaiji' },
  },
  {
    path: '/fours',
    name: 'fours',
    hidden: true,
    component: () => import('@/views/cxtj/gkjkfx/four'),
    meta: { title: '区域概况监控', icon: 'rshujucaiji' },
  },
  {
    path: '/threes',
    name: 'threes',
    hidden: true,
    component: () => import('@/views/cxtj/gkjkfx/three'),
    meta: { title: '行业概况监控', icon: 'rshujucaiji' },
  },
  {
    path: '/fpgks',
    name: 'fpgks',
    hidden: true,
    component: () => import('@/views/cxtj/gkjkfx/fpgk'),
    meta: { title: '发票概况', icon: 'rshujucaiji' },
  },
  {
    path: '/jsjfgkfxs',
    name: 'jsjfgkfxs',
    hidden: true,
    component: () => import('@/views/cxtj/gkjkfx/jsjfgkfx'),
    meta: { title: '减税降费概况分析', icon: 'rshujucaiji' },
  },
  {
    path: '/404',
    component: () => import('@/views/404'),
    hidden: true
  },

  {
    path: '/',
    component: Layout,
    redirect: '/index',
    children: [{
      path: 'index',
      name: 'Index',
      component: () => import('@/views/cxtj/gkjk/one'),
      meta: { title: '主页', icon: 'shouye', affix: true }
    }]
  },
  {
    path: '/cxtj',
    component: Layout,
    name: 'cxtj',
    meta: {
      title: '税源透视',
      icon: 'rshujucaiji'
    },
    children: [
      {
        path: 'zdsyhgl',
        name: 'zdsyhgl',
        component: () => import('@/views/cxtj/zdsygl/index'),
        meta: { title: '大企业名册信息' }
      },
      {
        path: 'qhjtzbmd',
        name: 'qhjtzbmd',
        component: () => import('@/views/cxtj/qhjtzbmd/index'),
        meta: { title: '千户集团总部名单' }
      },
      {
        path: 'qhjtcyqymd',
        name: 'qhjtcyqymd',
        component: () => import('@/views/cxtj/qhjtcyqymd/index'),
        meta: { title: '千户集团成员企业名单' }
      },
      {
        path: 'shenjlmqymd',
        name: 'shenjlmqymd',
        component: () => import('@/views/cxtj/shenjlmqymd/index'),
        meta: { title: '省局列名成员企业名单' }
      },
      {
        path: 'shijlmqymd',
        name: 'shijlmqymd',
        component: () => import('@/views/cxtj/shijlmqymd/index'),
        meta: { title: '市局列名成员企业名单' }
      },
      {
        path: 'jtxxk',
        name: 'jtxxk',
        component: () => import('@/views/cxtj/jtxxk/index'),
        meta: { title: '重点企业涉税信息' }
      },
      {
        path: 'hyssxxhz',
        name: 'hyssxxhz',
        component: () => import('@/views/cxtj/hyssxxhz/index'),
        meta: { title: '主要行业涉税信息' }
      },
      {
        path: 'one',
        name: 'one',
        component: () => import('@/views/cxtj/gkjk/one'),
        meta: { title: '税收概况' },
      },
      {
        path: 'three',
        name: 'three',
        component: () => import('@/views/cxtj/gkjk/three'),
        meta: { title: '行业概况' },
      },
      {
        path: 'two',
        name: 'two',
        component: () => import('@/views/cxtj/gkjk/two'),
        meta: { title: '经营概况' },
      },
      {
        path: 'four',
        name: 'four',
        component: () => import('@/views/cxtj/gkjk/four'),
        meta: { title: '区域概况' },
      },

      
     
      {
        path: 'qyjyqkfx',
        name: 'qyjyqkfx',
        component: () => import('@/views/cxtj/qyjyqkfx/index'),
        meta: { title: '企业经营情况分析' }
      },
      {
        path: 'qycwbbfx',
        name: 'qycwbbfx',
        component: () => import('@/views/cxtj/qycwbbfx/index'),
        meta: { title: '企业财务指标分析' }
      },
      {
        path: 'qycwbbfxmx',
        name: 'qycwbbfxmx',
        hidden: true,
        component: () => import('@/views/cxtj/qycwbbfx/index-zbmx'),
        meta: { title: '企业财务指标明细' }
      },

      {
        path: 'qyssqsfx',
        name: 'qyssqsfx',
        component: () => import('@/views/cxtj/qyssqsfx/index'),
        meta: { title: '企业税收趋势分析' }
      },
      {
        path: 'qyssmx',
        name: 'qyssmx',
        hidden:true,
        component: () => import('@/views/cxtj/qyssqsfx/qyssmx'),
        meta: { title: '企业税收明细' }
      },
      {
        path: 'qyfpmxfx',
        name: 'qyfpmxfx',
        component: () => import('@/views/cxtj/qyfpmxfx/index'),
        meta: { title: '企业发票明细分析' }
      },
      {
        path: 'jsjfmxfx',
        name: 'jsjfmxfx',
        component: () => import('@/views/cxtj/jsjfmxfx/index'),
        meta: { title: '企业减税降费明细分析' }
      },
      {
        path: 'qyjymxfx',
        name: 'qyjymxfx',
        component: () => import('@/views/cxtj/qyjymxfx/index'),
        meta: { title: '企业经营明细分析' }
      },
     
     
      {
        path: 'qyndrkfx',
        name: 'qyndrkfx',
        component: () => import('@/views/cxtj/qyndrkfx/index'),
        meta: { title: '企业入库税费分析' }
      },
      // {
      //   path: 'fpgk',
      //   name: 'fpgk',
      //   component: () => import('@/views/cxtj/gkjk/fpgk'),
      //   meta: { title: '发票概况监控' },
      // },
     
      // {
      //   path: 'jsjfgkjk',
      //   name: 'jsjfgkjk',
      //   component: () => import('@/views/cxtj/gkjk/jsjfgkfx'),
      //   meta: { title: '减税降费概况监控' }
      // }
      // ,
      {
        path: 'qtcgtj',
        name: 'qtcgtj',
        component: () => import('@/views/cxtj/qtcgtj/index'),
        meta: { title: '其他成果统计' },

      },
      {
        path: 'fxcx',
        name: 'fxcx',
        component: () => import('@/views/cxtj/fxcx/index'),
        meta: { title: '风险成效分析' },

      },


    ]
  },
 
  {
    path: '/znjks',
    component: Layout,
    name: 'znjks',
    meta: {
      title: '智能监控',
      icon: 'client'
    },
    children: [
      {
        path: 'ssjk',
        name: 'ssjk',
        component: () => import('@/views/znjk/ssjk/index'),
        // component: Layout,
        meta: { title: '实时监控'},
        children: [
          {
            path: 'zbjk',
            component: () => import('@/views/znjk/zbjk/index'),
            name: 'zbjk',
            meta: { title: '指标监控' }
          },
          {
            path: 'sxjk',
            component: () => import('@/views/znjk/sxjk/index'),
            name: 'sxjk',
            meta: { title: '事项监控' }
          },
        ]
      },
      {
        path: 'smfx',
        name: 'smfx',
        component: () => import('@/views/znjk/smfx/index'),
        meta: { title: '扫描分析' },
        children: [
          {
            path: 'mxsm',
            component: () => import('@/views/znjk/mxsm/index'),
            name: 'mxsm',
            meta: { title: '模型扫描' }
          },
          {
            path: 'sjdb',
            name: 'sjdb',
            component: () => import('@/views/tzyy/sjdb/index'),
            meta: { title: '数据比对' }
          },
          {
            path: 'znjk',
            component: () => import('@/views/znjk/zznjk/index'),
            name: 'znjk',
            meta: { title: '监控工具' }
          },
        ]
      }
    ]
  },
  {
    path: '/tzyy',
    component: Layout,
    name: 'tzyy',
    meta: {
      title: '拓展应用',
      icon: 'client'
    },
    children: [
      {
        path: 'sjkc',
        name: 'sjkc',
        component: () => import('@/views/tzyy/sjkc/index'),
        meta: { title: '数据扩充' }
      },
      {
        path: 'mxkc',
        name: 'mxkc',
        component: () => import('@/views/tzyy/mxkc/index'),
        meta: { title: '模型扩充' }
      },
      
    ]
  },
  {
    path: '/zcgj',
    component: Layout,
    name: 'zcgj',
    meta: {
      title: '支撑工具',
      icon: 'client'
    },
    children: [
      {
        path: 'yzgj',
        name: 'yzgj',
        component: () => import('@/views/zcgj/yzgj/index'),
        meta: { title: '阅帐工具' }
      },
      {
        path: 'gxbg',
        name: 'gxbg',
        component: () => import('@/views/zcgj/gxbg/index'),
        meta: { title: '共享表格' }
      }
    ]
  },
  // {
  //   path: '/help',
  //   component: Layout,
  //   redirect: '/profile',
  //   name: 'Help',
  //   meta: {
  //     title: '帮助文档',
  //     icon: 'nested'
  //   },
  //   children: [
  //     {
  //       path: '/profile',
  //       component: () => import('@/views/help/profile'),
  //       name: 'Profile',
  //       meta: {
  //         title: '简介'
  //         // icon: 'nested'
  //       },
  //       children: [
  //         {
  //           path: 'feature',
  //           component: () => import('@/views/help/profile/feature'),
  //           name: 'Feature',
  //           meta: { title: '特性' }
  //         },
  //         {
  //           path: 'dirconstruct',
  //           component: () => import('@/views/help/profile/dirconstruct'),
  //           name: 'Dirconstruct',
  //           meta: { title: '目录结构' }
  //         },
  //         {
  //           path: 'install',
  //           component: () => import('@/views/help/profile/install'),
  //           name: 'Install',
  //           meta: { title: '安装' }
  //         },
  //         {
  //           path: 'newpage',
  //           component: () => import('@/views/help/profile/newpage'),
  //           name: 'Newpage',
  //           meta: { title: '新增页面/组件' }
  //         }
  //       ]
  //     },
  //     {
  //       path: '/function',
  //       component: () => import('@/views/help/function'),
  //       name: 'Function',
  //       meta: {
  //         title: '功能'
  //         // icon: 'nested'
  //       },
  //       children: [
  //         {
  //           path: 'envvar',
  //           component: () => import('@/views/help/function/envVar'),
  //           name: 'Envvar',
  //           meta: { title: '环境变量' }
  //         },
  //         {
  //           path: 'mock',
  //           component: () => import('@/views/help/function/mock'),
  //           name: 'Mock',
  //           meta: { title: '接口模拟（Mock）' }
  //         },
  //         {
  //           path: 'permession',
  //           component: () => import('@/views/help/function/permession'),
  //           name: 'Permession',
  //           meta: { title: '权限验证' }
  //         },
  //         {
  //           path: 'themeChange',
  //           component: () => import('@/views/help/function/themeChange'),
  //           name: 'ThemeChange',
  //           meta: { title: '主题切换' }
  //         }
  //       ]
  //     }
  //   ]
  // },
  // {
  //   path: '/example',
  //   component: Layout,
  //   redirect: '/example/table',
  //   name: 'Example',
  //   meta: { title: 'Example', icon: 'example' },
  //   children: [
  //     {
  //       path: 'table',
  //       name: 'Table',
  //       component: () => import('@/views/table/index'),
  //       meta: { title: 'Table', icon: 'table' }
  //     },
  //     {
  //       path: 'tree',
  //       name: 'Tree',
  //       component: () => import('@/views/tree/index'),
  //       meta: { title: 'Tree', icon: 'tree' }
  //     }
  //   ]
  // },
  // {
  //   path: '/nested',
  //   component: Layout,
  //   redirect: '/nested/menu1',
  //   name: 'Nested',
  //   meta: {
  //     title: 'Nested',
  //     icon: 'nested'
  //   },
  //   children: [
  //     {
  //       path: 'menu1',
  //       component: () => import('@/views/nested/menu1/index'), // Parent router-view
  //       name: 'Menu1',
  //       meta: { title: 'Menu1' },
  //       children: [
  //         {
  //           path: 'menu1-1',
  //           component: () => import('@/views/nested/menu1/menu1-1'),
  //           name: 'Menu1-1',
  //           meta: { title: 'Menu1-1' }
  //         },
  //         {
  //           path: 'menu1-2',
  //           component: () => import('@/views/nested/menu1/menu1-2'),
  //           name: 'Menu1-2',
  //           meta: { title: 'Menu1-2' },
  //           children: [
  //             {
  //               path: 'menu1-2-1',
  //               component: () => import('@/views/nested/menu1/menu1-2/menu1-2-1'),
  //               name: 'Menu1-2-1',
  //               meta: { title: 'Menu1-2-1' }
  //             },
  //             {
  //               path: 'menu1-2-2',
  //               component: () => import('@/views/nested/menu1/menu1-2/menu1-2-2'),
  //               name: 'Menu1-2-2',
  //               meta: { title: 'Menu1-2-2' }
  //             }
  //           ]
  //         },
  //         {
  //           path: 'menu1-3',
  //           component: () => import('@/views/nested/menu1/menu1-3'),
  //           name: 'Menu1-3',
  //           meta: { title: 'Menu1-3' }
  //         }
  //       ]
  //     },
  //     {
  //       path: 'menu2',
  //       component: () => import('@/views/nested/menu2/index'),
  //       meta: { title: 'menu2' }
  //     }
  //   ]
  // },

  // {
  //   path: 'external-link',
  //   component: Layout,
  //   children: [
  //     {
  //       path: 'https://panjiachen.github.io/vue-element-admin-site/#/',
  //       meta: { title: 'External Link', icon: 'link' }
  //     }
  //   ]
  // },

  // 404 page must be placed at the end !!!
  { path: '*', redirect: '/404', hidden: true },

]

const createRouter = () => new Router({
  mode: 'hash', // require service support
  // base:"/zs/dqygl/dist",
  scrollBehavior: () => ({ y: 0 }),
  routes: constantRoutes
})

const router = createRouter()

// Detail see: https://github.com/vuejs/vue-router/issues/1234#issuecomment-357941465
export function resetRouter() {
  const newRouter = createRouter()
  router.matcher = newRouter.matcher // reset router
}

export default router
